from django.db import models
from app.models import BaseModel

# Create your models here.


class CustomerIntention(BaseModel):
    """
    序号	部门组别	业务员	时间	客户姓名	客户级别	联系电话	是否上门	上门时间	签约情况	备注
    """
    department = models.CharField(
        max_length=30, verbose_name="部门组别", null=True, blank=True, db_comment='部门组别', default='三部七组')

    time = models.DateField(
        verbose_name="时间", null=True, blank=True, db_comment='时间')
    name = models.CharField(
        max_length=100, verbose_name="客户姓名", null=True, blank=True, db_comment='客户姓名')
    customer_status = models.TextField(
        verbose_name="客户情况", null=True, blank=True, db_comment='客户情况')
    level = models.CharField(
        max_length=5, verbose_name="客户级别", null=True, blank=True, db_comment='客户级别')
    phone = models.CharField(
        max_length=100, verbose_name="联系电话", null=True, blank=True, db_comment='联系电话')
    is_visit = models.BooleanField(
        default=False, verbose_name="是否上门", null=True, blank=True, db_comment='是否上门')
    visit_time = models.DateTimeField(
        verbose_name="上门时间", null=True, blank=True, db_comment='上门时间')
    sign = models.BooleanField(
        default=False, verbose_name="签约情况", null=True, blank=True, db_comment='签约情况')
    remark = models.TextField(
        verbose_name="客户备注", null=True, blank=True, db_comment='客户备注')

    def __str__(self):
        return self.name or "未命名客户"

    class Meta:
        db_table = "loan_customer_intention"
        verbose_name = "客户意向"
        verbose_name_plural = "01.客户意向"
        db_table_comment = '客户意向表'
